// 蜂窝蜜造平台生成代码，如手工更改，请添加到 .beeignore 忽略生成

package com.fowo.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fowo.api.common.model.OptionItem;
import com.fowo.api.entity.Receipt;
import com.fowo.api.model.receipt.ReceiptItemVo;
import com.fowo.api.model.receipt.ReceiptQuerySubtableParam;
import com.fowo.api.model.receipt.ReceiptQuerySubtableResult;
import com.fowo.api.model.receipt.ReceiptSearchParamPo;
import com.fowo.api.model.receipt.ReceiptVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ReceiptMapper extends BaseMapper<Receipt> {
  Page<ReceiptItemVo> pageSearch(
    @Param("page") Page page,
    @Param("search") ReceiptSearchParamPo search
  );
  List<OptionItem<ReceiptItemVo>> searchOptions(
    @Param("search") ReceiptSearchParamPo search
  );
  List<ReceiptItemVo> search(@Param("search") ReceiptSearchParamPo search);
  Date searchLastUpdateTime(@Param("search") ReceiptSearchParamPo search);
  /**
   * 搜索满足条件的所有记录的编号列表
   * @param search 搜索参数
   * @return 编号列表
   */
  List<Long> searchIds(@Param("search") ReceiptSearchParamPo search);
  /**
   * 搜索满足条件的记录数量
   * @param search 搜索参数
   * @return 记录数量
   */
  Long searchCount(@Param("search") ReceiptSearchParamPo search);
  Long getIdByOrderSn(@Param("orderSn") String orderSn);

  List<Long> getIdsByOrderSn(@Param("list") List<String> list);

  String getOrderSnById(@Param("id") Long id);

  List<Map<String, Object>> getOrderSnByIds(@Param("ids") List<Long> ids);
  ReceiptVo selectVoById(@Param("id") Long id);
  /**
   * 全部
   */
  List<ReceiptItemVo> all1(@Param("search") ReceiptSearchParamPo search);

  /**
   * 获取全部编号列表
   */
  List<Long> all1Ids(@Param("search") ReceiptSearchParamPo search);

  /**
   * 获取全部的总数
   */
  Long all1Count(@Param("search") ReceiptSearchParamPo search);

  /**
   * 全部分页
   */
  Page<ReceiptItemVo> all1Page(
    @Param("page") Page page,
    @Param("search") ReceiptSearchParamPo search
  );
  Date all1LastUpdateTime(@Param("search") ReceiptSearchParamPo search);
  /**
   * 待收货
   */
  List<ReceiptItemVo> waitForReceiving(
    @Param("search") ReceiptSearchParamPo search
  );

  /**
   * 获取待收货编号列表
   */
  List<Long> waitForReceivingIds(@Param("search") ReceiptSearchParamPo search);

  /**
   * 获取待收货的总数
   */
  Long waitForReceivingCount(@Param("search") ReceiptSearchParamPo search);

  /**
   * 待收货分页
   */
  Page<ReceiptItemVo> waitForReceivingPage(
    @Param("page") Page page,
    @Param("search") ReceiptSearchParamPo search
  );
  Date waitForReceivingLastUpdateTime(
    @Param("search") ReceiptSearchParamPo search
  );
  /**
   * 已完成
   */
  List<ReceiptItemVo> done(@Param("search") ReceiptSearchParamPo search);

  /**
   * 获取已完成编号列表
   */
  List<Long> doneIds(@Param("search") ReceiptSearchParamPo search);

  /**
   * 获取已完成的总数
   */
  Long doneCount(@Param("search") ReceiptSearchParamPo search);

  /**
   * 已完成分页
   */
  Page<ReceiptItemVo> donePage(
    @Param("page") Page page,
    @Param("search") ReceiptSearchParamPo search
  );
  Date doneLastUpdateTime(@Param("search") ReceiptSearchParamPo search);
  /**
   * 更新收货单的状态为1
   */
  void updateReceiptStatusToFinished();
  /**
   * 质检按钮更新数据
   */
  void checkButtonUpdatesData();
  /**
   * 收货单收货按钮
   */
  void receiptReceiptButton();
  /**
   * 快捷入库
   */
  void quickStorage();
  /**
   * 查询子表
   */
  List<ReceiptQuerySubtableResult> querySubtable(
    ReceiptQuerySubtableParam param
  );
  /**
   * 关联单据（入库单）
   */
  void relatedDocuments();
  /**
   * 查询子表数据
   */
  void querySubtableData();
  /**
   * 关联单据（质检单）
   */
  void relatedDocumentsQqualityInspectionForm();
  /**
   * 免检
   */
  void exemptedInspection();
}
